# 1.拼接一个字符串，长度为4。其实就是随机生成验证码

str1 = '1234567890qwertyuiopasdfghjklzxcvbnmQWERTYUIOPASDFGHJKLZXCVBNM'

import random

list1 = random.choices(str1, k=4)
print(list1)
# str_end = ''
# s = str_end.join(list1)
# # for i in list1:
# #     str_end += i
# print(str_end)
#
# print(s)


from functools import reduce

s = reduce(lambda x, y: x + y, list1)
print(s)
print(type(s))

print(chr(97))
print(ord('a'))

num = ''
for i in range(48, 57 + 1):
    num += chr(i)
print(num)

lowerstr = ''
for i in range(97, 122 + 1):
    lowerstr += chr(i)
print(lowerstr)
upperstr = ''
for i in range(65, 90 + 1):
    upperstr += chr(i)
print(upperstr)

str1 = num + lowerstr + upperstr
print(str1)
